
package controllers;

import entity.Customer;
import entity.InfoBooking;
import java.util.ArrayList;
import java.util.List;

public class InfoBookController {
    
    
   public static ArrayList<entity.InfoBooking> getAll(){
       return new dao.InfoBooking().getAllInfoBooking(); 
   }
   public static boolean insert(int id,entity.InfoBooking InfoBooking){  
       return new dao.InfoBooking().addInfoBooking(id,InfoBooking.getDate(),
                                                   InfoBooking.getNumber_room(),InfoBooking.getTotal(),
                                                   InfoBooking.getPayment(),InfoBooking.getCheckin(),
                                                   InfoBooking.getCheckout(),InfoBooking.getStatus());
    }
   public static boolean update (entity.InfoBooking InfoBooking){   
       return  new dao.InfoBooking().updateInfoBooking(InfoBooking.getId_customer(),InfoBooking.getDate(),
                                                       InfoBooking.getNumber_room(),InfoBooking.getTotal(),
                                                       InfoBooking.getPayment(),InfoBooking.getCheckin(),
                                                       InfoBooking.getCheckout(),InfoBooking.getStatus());
   }
  public static boolean updateStatus (int idcustomer,int status){  
      return new dao.InfoBooking().updateStatus(idcustomer, status);
  }
  public static boolean remove(int id){
      return new dao.InfoBooking().deleteInfoBooking(id);
  }
  public static List<entity.InfoBooking> getByStatus(int status){
      return new dao.InfoBooking().getInfoBookingByStatus(status);
  }
  public static InfoBooking getByCustomer(int id){
      return new dao.InfoBooking().getInfoBookingByCustomer(id);
  }
  public static int getStatus(int id){
      return getByCustomer(id).getStatus();
  }
  
}
